#!/usr/bin/env python
'''Gui

Some useful classes for GUIs shortcuts
'''

import pygtk
pygtk.require("2.0")
import gtk

class ErrorBox(gtk.MessageDialog):
    '''A convenient class for error boxes'''

    def __init__(self, parent=None, str="Error!"):
        gtk.MessageDialog.__init__(self, parent, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
                gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, str)
        if self.run():
            self.destroy()

class InfoBox(gtk.MessageDialog):
    '''A convenient class for info boxes'''

    def __init__(self, parent=None, str="Informations..."):
        gtk.MessageDialog.__init__(self, parent, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT
                , gtk.MESSAGE_INFO, gtk.BUTTONS_OK, str)
        if self.run():
            self.destroy()
